﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Infragistics.WebUI.UltraWebListbar;

public partial class index_xtsz :PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadItem();
        }
    }

    #region Web 窗体设计器生成的代码

    protected override void OnLoad(EventArgs e)
    {
        isRequestLogin = true;                                  //是否需要登录
        RequestLoginPage = this.Request.Url.AbsoluteUri;        //获取决对Url
        isAtFramePageLogin = true;                              //是框架页

        RequestCompetences = Competences.BuildCompetencesList(Competences.SetSystem); //页面权限

        base.OnLoad(e);
    }

    #endregion

    private void LoadItem()
    {
        lbMain.Groups.Clear();

        Group group_xtsz = new Group("系统设置", "g_xtsz");
        setGroupStyle(group_xtsz);
        lbMain.Groups.Add(group_xtsz);
        Items items_xtsz = lbMain.Groups.FromKey("g_xtsz").Items;
        items_xtsz.Clear();

        items_xtsz.Add(new Item("密码修改", "./images/clearing/9_dian.jpg", "SystemManage/EditPassword.aspx"));
        //items_xtsz.Add(new Item("系统注册", "./images/clearing/9_dian.jpg", ""));
        items_xtsz.Add(new Item("选项设置", "./images/clearing/9_dian.jpg", "SystemManage/Options.aspx"));
        items_xtsz.Add(new Item("系统重建", "./images/clearing/9_dian.jpg", "SystemManage/SystemRebuild.aspx"));


        Group group_rzgl = new Group("日志管理", "g_rzgl");
        setGroupStyle(group_rzgl);
        lbMain.Groups.Add(group_rzgl);
        Items items_rzgl = lbMain.Groups.FromKey("g_rzgl").Items;
        items_rzgl.Clear();

        items_rzgl.Add(new Item("用户登录日志", "./images/clearing/9_dian.jpg", "SystemManage/LoginLog.aspx"));
        items_rzgl.Add(new Item("系统操作日志", "./images/clearing/9_dian.jpg", "SystemManage/OperationLog.aspx"));

        Group group_qxgl = new Group("权限管理", "g_qxgl");
        setGroupStyle(group_qxgl);
        lbMain.Groups.Add(group_qxgl);
        Items items_qxgl = lbMain.Groups.FromKey("g_qxgl").Items;
        items_qxgl.Clear();

        items_qxgl.Add(new Item("添加管理员", "./images/clearing/9_dian.jpg", "SystemManage/AdminAdd.aspx"));
        items_qxgl.Add(new Item("组权限管理", "./images/clearing/9_dian.jpg", "SystemManage/GroupCompetence_Manager.aspx"));
        items_qxgl.Add(new Item("会员权限管理", "./images/clearing/9_dian.jpg", "SystemManage/OperatorInCompetence.aspx"));

        Group group_sjbf = new Group("数据备份", "g_sjbf");
        setGroupStyle(group_sjbf);
        lbMain.Groups.Add(group_sjbf);
        Items items_sjbf = lbMain.Groups.FromKey("g_sjbf").Items;
        items_sjbf.Clear();

        items_sjbf.Add(new Item("备份数据库", "./images/clearing/9_dian.jpg", "SystemManage/Backup.aspx"));
        items_sjbf.Add(new Item("执行SQL", "./images/clearing/9_dian.jpg", "SystemManage/ExecSQLScript.aspx"));


        Group group_g = new Group("", "g");
        lbMain.Groups.Add(group_g);
        setGroupStyle(group_g);
        Items items_g = lbMain.Groups.FromKey("g").Items;
        items_g.Clear();
        group_g.Enabled = false;
    }

    private void setGroupStyle(Group group)
    {
        group.Expanded = false;
        group.TextAlign = "left";
        group.ItemAlign = "left";
        group.ImageTextAlign = ImageTextAlign.Middle;
    }
}
